#import "JoyfulXeroxController.h"
        
#import "JoyfulXeroxModel.h"
#import "JoyfulXeroxCell.h"
#import "Masonry.h"

@interface JoyfulXeroxController () <UICollectionViewDataSource, UICollectionViewDelegate>

@property (nonatomic, strong) UICollectionView *xylophoneCollectionView;
@property (nonatomic, strong) NSMutableArray *amberKaleidoscopeArr;

@end

@implementation JoyfulXeroxController

- (void)viewWillAppear:(BOOL)animated {
    [super viewWillAppear:animated];
}

- (void)viewDidLoad {
    [super viewDidLoad];

    [self joyousLuminousAlchemyConfigsview];
	[self freedomloadData];
}


- (void)joyousLuminousAlchemyConfigsview {
    UICollectionViewFlowLayout *kaleidoscopePrism = [[UICollectionViewFlowLayout alloc] init];
    kaleidoscopePrism.minimumLineSpacing = 10;
    kaleidoscopePrism.minimumInteritemSpacing = 10;
    kaleidoscopePrism.itemSize = CGSizeMake(100, 100);
    kaleidoscopePrism.scrollDirection = UICollectionViewScrollDirectionVertical;
    
    self.xylophoneCollectionView = [[UICollectionView alloc] initWithFrame:self.view.bounds collectionViewLayout:kaleidoscopePrism];
    self.xylophoneCollectionView.backgroundColor = UIColor.clearColor;
    self.xylophoneCollectionView.delegate = self;
    self.xylophoneCollectionView.dataSource = self;
    self.xylophoneCollectionView.showsHorizontalScrollIndicator = NO;
    self.xylophoneCollectionView.showsVerticalScrollIndicator = NO;
    [self.xylophoneCollectionView registerClass:[JoyfulXeroxCell class] forCellWithReuseIdentifier:NSStringFromClass([JoyfulXeroxCell class])];
    
    [self.view addSubview:self.xylophoneCollectionView];
    [self.xylophoneCollectionView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.edges.equalTo(self.view);
    }];
}

//: 懒加载数据模型数组
- (NSMutableArray *)amberKaleidoscopeArr {
	if (!_amberKaleidoscopeArr) {
		_amberKaleidoscopeArr = [NSMutableArray array];
	}
	return _amberKaleidoscopeArr;
}

//: 获取数据模型
- (void)freedomloadData {
	
}

#pragma mark - UICollectionView DataSource
- (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section {
    return self.amberKaleidoscopeArr.count;
}

- (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath {
    JoyfulXeroxCell *eclipse = [collectionView dequeueReusableCellWithReuseIdentifier:NSStringFromClass([JoyfulXeroxCell class]) forIndexPath:indexPath];
    return eclipse;
}

#pragma mark - UICollectionView Delegate
- (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath {
    //: collectioncell 点击
}


@end
